package com.android.place360.geocoding;

import java.util.*;


import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.*;



public class CustomListAdapterLocation extends ArrayAdapter<String> {

	ArrayList<String> listLocations;
	int resource;
	Context context;
	private boolean showCheckbox =false;
	
	public boolean isShowCheckbox() {
		return showCheckbox;
	}

	public void setShowCheckbox(boolean showCheckbox) {
		this.showCheckbox = showCheckbox;
	}

	public CustomListAdapterLocation(Context context, int textViewResourceId,
			ArrayList<String> objects) {

		super(context, textViewResourceId, objects);
		this.context = context;
		resource = textViewResourceId;
		listLocations = objects;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {

		if (convertView == null) {
			convertView = new CustomListLocation(getContext());
		}

		final String item = listLocations.get(position);

		if (convertView != null) {
		
			TextView locationNameTextView = ((CustomListLocation) convertView)
					.getLocation();
			
			locationNameTextView.setText(item);
		}
		return convertView;
	}

}
